<div class="form-group">
    <label for="service_url" class="control-label col-xs-2">服务地址</label>
    <div class="col-xs-10">
        <input type="text" ng-model="dataset_defines.DataServiceMeta.QueryUrlAddress" class="form-control" ng-change="serviceChanged()"
               required name="service_url" id="service_url" placeholder="服务地址">
        <br/>
        <span>注：服务为get方式请求，参数通过?param=${paramVariable}传递，参数变量在调用过程中进行替换，可设置默认值。</span>
        <br/>
        <br/>
    </div>
</div>
<div class="form-group">
    <label class="control-label col-xs-2">转换脚本</label>
    <div class="col-xs-10 sql_container">
        <div class="row">
            <div ui-ace="{
            require: ['ace/ext/language_tools'],
            onLoad : aceLoaded,
            onChange: aceChanged
            }"></div>
        </div>
        <br/>
        <span>注：转换JS脚本可作为服务调用返回数据的解析扩展逻辑，传入服务器调用JSON字符串，返回解析后的JSON字符串，要求格式JSON对象或数组对象。</span>
        <br/>
        <div class="row action_container">
            <a type="button" ng-click="executeService()" class="btn btn-success pull-right">执行</a>
            <a type="button" ng-disabled="paramsList.length==0" ng-click="paramsSet()" class="btn btn-default pull-right">参数</a>
        </div>
    </div>
</div>
<div class="form-group">
    <label class="control-label col-xs-2">查询执行结果</label>
    <div class="col-xs-10 result_container">
        <div class="database_result_container">
            <table ng-show="executeData.length > 0">
                <thead>
                <th ng-repeat="c in dataColumns">{{ c }}
                </th>
                </thead>
                <tbody>
                <tr ng-repeat="d in executeData">
                    <td ng-repeat="c in dataColumns">{{ d[dataColumns.indexOf(c)] }}</td>
                </tr>
                </tbody>
            </table>
            <span ng-show="executeData.length == 0">无数据</span>
        </div>
    </div>
</div>
<div class="form-group">
    <label class="control-label col-xs-2">模型列映射</label>
    <div class="col-xs-10">
        <table class="edittable">
            <thead>
            <tr>
                <th>数据模型编码</th>
                <th>数据模型名称</th>
                <th>数据列名称</th>
            </tr>
            </thead>
            <tbody>
            <tr ng-repeat="column in dataset_defines.DataColumnsMap">
                <td>{{column.Code}}</td>
                <td>{{column.Name}}</td>
                <td>
                    <select ng-options="c as c for c in dataColumns" class="form-control"
                            required ng-model="column.Column"></select>
                </td>
            </tr>
            </tbody>
        </table>
    </div>
</div>